package com.java2007.hotel.dao;

import com.java2007.hotel.pojo.Order;

import java.sql.SQLException;
import java.util.List;

/**
 * @author Reckeys
 * @version V1.0
 * @date 2021/01/28
 **/
public interface OrderDao {
    /**
     * 添加订单
     * @param order
     * @return
     */
    int addOrder(Order order) throws SQLException;

    /**
     * 修改订单
     * @return
     */
    int updateOrder(Order order) throws SQLException;

    /**
     * 查询所有订单
     * @return
     */
    List<Order> findAllOrder() throws SQLException;

    /**
     * 通过id查询一条订单信息
     * @param orderId
     * @return
     */
    Order findOrder(Long orderId) throws SQLException;

    /**
     * 通过用户id查询用户下的订单
     * @param userId
     * @return
     */
    List<Order> findOrderByCreatUserId(Integer userId) throws SQLException;
}
